<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>&lt;GTimeZone&gt;: </title>
<meta name="generator" content="DocBook XSL Stylesheets V1.79.2">
<link rel="home" href="index.html" title="">
<link rel="up" href="ch01.html" title="GLib">
<link rel="prev" href="re68.html" title="&lt;%GLibTimeType&gt;">
<link rel="next" href="re70.html" title="&lt;%GLibTokenType&gt;">
<meta name="generator" content="GTK-Doc V1.33.1 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="5"><tr valign="middle">
<td width="100%" align="left" class="shortcuts"></td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="16" height="16" border="0" alt="Home"></a></td>
<td><img src="up-insensitive.png" width="16" height="16" border="0"></td>
<td><a accesskey="p" href="re68.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td>
<td><a accesskey="n" href="re70.html"><img src="right.png" width="16" height="16" border="0" alt="Next"></a></td>
</tr></table>
<div class="refentry">
<a name="id-1.1.70"></a><div class="titlepage"></div>
<div class="refnamediv">
<h2>&lt;GTimeZone&gt;</h2>
<p>&lt;GTimeZone&gt;</p>
</div>
<div class="refsect1">
<a name="id-1.1.70.2"></a><h2>Description</h2>
<p><span class="type">GTimeZone</span> is an opaque structure whose members cannot be accessed
directly.</p>
</div>
<div class="refsect1">
<a name="id-1.1.70.3"></a><h2>Functions</h2>
<div class="refsect2">
<a name="id-1.1.70.3.2"></a><h3>adjust-time</h3>
<div class="informalexample"><pre class="programlisting">(define-values (%return) (time-zone:adjust-time self type time-))
</pre></div>
<p>Finds an interval within <em class="parameter"><code>tz</code></em> that corresponds to the given <em class="parameter"><code>time_</code></em>,
possibly adjusting <em class="parameter"><code>time_</code></em> if required to fit into an interval.
The meaning of <em class="parameter"><code>time_</code></em> depends on <em class="parameter"><code>type</code></em>.
</p>
<p>This function is similar to <code class="function">g_time_zone_find_interval()</code>, with the
difference that it always succeeds (by making the adjustments
described below).
</p>
<p>In any of the cases where <code class="function">g_time_zone_find_interval()</code> succeeds then
this function returns the same value, without modifying <em class="parameter"><code>time_</code></em>.
</p>
<p>This function may, however, modify <em class="parameter"><code>time_</code></em> in order to deal with
non-existent times.  If the non-existent local <em class="parameter"><code>time_</code></em> of 02:30 were
requested on March 14th 2010 in Toronto then this function would
adjust <em class="parameter"><code>time_</code></em> to be 03:00 and return the interval containing the
adjusted time.</p>
<div class="refsect3">
<a name="id-1.1.70.3.2.7"></a><h4>Parameters</h4>
<div class="informaltable"><table>
<tr>
<td class="parameter_name"><p>tz</p></td>
<td class="parameter_description">
<p>a <span class="type">GTimeZone</span></p>
<p>Passed as <code class="code">self</code></p>
</td>
</tr>
<tr>
<td class="parameter_name"><p>type</p></td>
<td class="parameter_description">
<p>the <span class="type">GTimeType</span> of <em class="parameter"><code>time_</code></em></p>
<p>Passed as <code class="code">type</code></p>
</td>
</tr>
<tr>
<td class="parameter_name"><p>time_</p></td>
<td class="parameter_description">
<p>a pointer to a number of seconds since January 1, 1970</p>
<p>Passed as <code class="code">time-</code></p>
</td>
</tr>
</table></div>
</div>
</div>
<div class="refsect2">
<a name="id-1.1.70.3.3"></a><h3>find-interval</h3>
<div class="informalexample"><pre class="programlisting">(define-values (%return) (time-zone:find-interval self type time-))
</pre></div>
<p>Finds an interval within <em class="parameter"><code>tz</code></em> that corresponds to the given <em class="parameter"><code>time_</code></em>.
The meaning of <em class="parameter"><code>time_</code></em> depends on <em class="parameter"><code>type</code></em>.
</p>
<p>If <em class="parameter"><code>type</code></em> is <code class="constant">G_TIME_TYPE_UNIVERSAL</code> then this function will always
succeed (since universal time is monotonic and continuous).
</p>
<p>Otherwise <em class="parameter"><code>time_</code></em> is treated as local time.  The distinction between
<code class="constant">G_TIME_TYPE_STANDARD</code> and <code class="constant">G_TIME_TYPE_DAYLIGHT</code> is ignored except in
the case that the given <em class="parameter"><code>time_</code></em> is ambiguous.  In Toronto, for example,
01:30 on November 7th 2010 occurred twice (once inside of daylight
savings time and the next, an hour later, outside of daylight savings
time).  In this case, the different value of <em class="parameter"><code>type</code></em> would result in a
different interval being returned.
</p>
<p>It is still possible for this function to fail.  In Toronto, for
example, 02:00 on March 14th 2010 does not exist (due to the leap
forward to begin daylight savings time).  -1 is returned in that
case.</p>
<div class="refsect3">
<a name="id-1.1.70.3.3.7"></a><h4>Parameters</h4>
<div class="informaltable"><table>
<tr>
<td class="parameter_name"><p>tz</p></td>
<td class="parameter_description">
<p>a <span class="type">GTimeZone</span></p>
<p>Passed as <code class="code">self</code></p>
</td>
</tr>
<tr>
<td class="parameter_name"><p>type</p></td>
<td class="parameter_description">
<p>the <span class="type">GTimeType</span> of <em class="parameter"><code>time_</code></em></p>
<p>Passed as <code class="code">type</code></p>
</td>
</tr>
<tr>
<td class="parameter_name"><p>time_</p></td>
<td class="parameter_description">
<p>a number of seconds since January 1, 1970</p>
<p>Passed as <code class="code">time-</code></p>
</td>
</tr>
</table></div>
</div>
</div>
<div class="refsect2">
<a name="id-1.1.70.3.4"></a><h3>get-abbreviation</h3>
<div class="informalexample"><pre class="programlisting">(define-values (%return) (time-zone:get-abbreviation self interval))
</pre></div>
<p>Determines the time zone abbreviation to be used during a particular
<em class="parameter"><code>interval</code></em> of time in the time zone <em class="parameter"><code>tz</code></em>.
</p>
<p>For example, in Toronto this is currently "EST" during the winter
months and "EDT" during the summer months when daylight savings time
is in effect.</p>
<div class="refsect3">
<a name="id-1.1.70.3.4.5"></a><h4>Parameters</h4>
<div class="informaltable"><table>
<tr>
<td class="parameter_name"><p>tz</p></td>
<td class="parameter_description">
<p>a <span class="type">GTimeZone</span></p>
<p>Passed as <code class="code">self</code></p>
</td>
</tr>
<tr>
<td class="parameter_name"><p>interval</p></td>
<td class="parameter_description">
<p>an interval within the timezone</p>
<p>Passed as <code class="code">interval</code></p>
</td>
</tr>
</table></div>
</div>
</div>
<div class="refsect2">
<a name="id-1.1.70.3.5"></a><h3>get-identifier</h3>
<div class="informalexample"><pre class="programlisting">(define-values (%return) (time-zone:get-identifier self))
</pre></div>
<p>Get the identifier of this <span class="type">GTimeZone</span>, as passed to <code class="function">g_time_zone_new()</code>.
If the identifier passed at construction time was not recognised, <code class="code">UTC</code> will
be returned. If it was <code class="constant">NULL</code>, the identifier of the local timezone at
construction time will be returned.
</p>
<p>The identifier will be returned in the same format as provided at
construction time: if provided as a time offset, that will be returned by
this function.</p>
<div class="refsect3">
<a name="id-1.1.70.3.5.5"></a><h4>Parameters</h4>
<div class="informaltable"><table><tr>
<td class="parameter_name"><p>tz</p></td>
<td class="parameter_description">
<p>a <span class="type">GTimeZone</span></p>
<p>Passed as <code class="code">self</code></p>
</td>
</tr></table></div>
</div>
</div>
<div class="refsect2">
<a name="id-1.1.70.3.6"></a><h3>get-offset</h3>
<div class="informalexample"><pre class="programlisting">(define-values (%return) (time-zone:get-offset self interval))
</pre></div>
<p>Determines the offset to UTC in effect during a particular <em class="parameter"><code>interval</code></em>
of time in the time zone <em class="parameter"><code>tz</code></em>.
</p>
<p>The offset is the number of seconds that you add to UTC time to
arrive at local time for <em class="parameter"><code>tz</code></em> (ie: negative numbers for time zones
west of GMT, positive numbers for east).</p>
<div class="refsect3">
<a name="id-1.1.70.3.6.5"></a><h4>Parameters</h4>
<div class="informaltable"><table>
<tr>
<td class="parameter_name"><p>tz</p></td>
<td class="parameter_description">
<p>a <span class="type">GTimeZone</span></p>
<p>Passed as <code class="code">self</code></p>
</td>
</tr>
<tr>
<td class="parameter_name"><p>interval</p></td>
<td class="parameter_description">
<p>an interval within the timezone</p>
<p>Passed as <code class="code">interval</code></p>
</td>
</tr>
</table></div>
</div>
</div>
<div class="refsect2">
<a name="id-1.1.70.3.7"></a><h3>is-dst?</h3>
<div class="informalexample"><pre class="programlisting">(define-values (%return) (time-zone:is-dst? self interval))
</pre></div>
<p>Determines if daylight savings time is in effect during a particular
<em class="parameter"><code>interval</code></em> of time in the time zone <em class="parameter"><code>tz</code></em>.</p>
<div class="refsect3">
<a name="id-1.1.70.3.7.4"></a><h4>Parameters</h4>
<div class="informaltable"><table>
<tr>
<td class="parameter_name"><p>tz</p></td>
<td class="parameter_description">
<p>a <span class="type">GTimeZone</span></p>
<p>Passed as <code class="code">self</code></p>
</td>
</tr>
<tr>
<td class="parameter_name"><p>interval</p></td>
<td class="parameter_description">
<p>an interval within the timezone</p>
<p>Passed as <code class="code">interval</code></p>
</td>
</tr>
</table></div>
</div>
</div>
<div class="refsect2">
<a name="id-1.1.70.3.8"></a><h3>ref</h3>
<div class="informalexample"><pre class="programlisting">(define-values (%return) (time-zone:ref self))
</pre></div>
<p>Increases the reference count on <em class="parameter"><code>tz</code></em>.</p>
<div class="refsect3">
<a name="id-1.1.70.3.8.4"></a><h4>Parameters</h4>
<div class="informaltable"><table><tr>
<td class="parameter_name"><p>tz</p></td>
<td class="parameter_description">
<p>a <span class="type">GTimeZone</span></p>
<p>Passed as <code class="code">self</code></p>
</td>
</tr></table></div>
</div>
</div>
<div class="refsect2">
<a name="id-1.1.70.3.9"></a><h3>unref</h3>
<div class="informalexample"><pre class="programlisting">(define-values () (time-zone:unref self))
</pre></div>
<p>Decreases the reference count on <em class="parameter"><code>tz</code></em>.</p>
<div class="refsect3">
<a name="id-1.1.70.3.9.4"></a><h4>Parameters</h4>
<div class="informaltable"><table><tr>
<td class="parameter_name"><p>tz</p></td>
<td class="parameter_description">
<p>a <span class="type">GTimeZone</span></p>
<p>Passed as <code class="code">self</code></p>
</td>
</tr></table></div>
</div>
</div>
<div class="refsect2">
<a name="id-1.1.70.3.10"></a><h3>time-zone:new-utc</h3>
<div class="informalexample"><pre class="programlisting">(define-values (%return) (time-zone:new-utc))
</pre></div>
<p>Undocumented</p>
</div>
<div class="refsect2">
<a name="id-1.1.70.3.11"></a><h3>time-zone:new-offset</h3>
<div class="informalexample"><pre class="programlisting">(define-values (%return) (time-zone:new-offset seconds))
</pre></div>
<p>Undocumented</p>
<div class="refsect3">
<a name="id-1.1.70.3.11.4"></a><h4>Parameters</h4>
<div class="informaltable"><table><tr>
<td class="parameter_name"><p>seconds</p></td>
<td class="parameter_description">
<p></p>
<p>Passed as <code class="code">seconds</code></p>
</td>
</tr></table></div>
</div>
</div>
<div class="refsect2">
<a name="id-1.1.70.3.12"></a><h3>time-zone:new-local</h3>
<div class="informalexample"><pre class="programlisting">(define-values (%return) (time-zone:new-local))
</pre></div>
<p>Undocumented</p>
</div>
<div class="refsect2">
<a name="id-1.1.70.3.13"></a><h3>time-zone:new-identifier</h3>
<div class="informalexample"><pre class="programlisting">(define-values (%return) (time-zone:new-identifier identifier))
</pre></div>
<p>Undocumented</p>
<div class="refsect3">
<a name="id-1.1.70.3.13.4"></a><h4>Parameters</h4>
<div class="informaltable"><table><tr>
<td class="parameter_name"><p>identifier</p></td>
<td class="parameter_description">
<p></p>
<p>Passed as <code class="code">identifier</code></p>
</td>
</tr></table></div>
</div>
</div>
<div class="refsect2">
<a name="id-1.1.70.3.14"></a><h3>time-zone:new</h3>
<div class="informalexample"><pre class="programlisting">(define-values (%return) (time-zone:new identifier))
</pre></div>
<p>Undocumented</p>
<div class="refsect3">
<a name="id-1.1.70.3.14.4"></a><h4>Parameters</h4>
<div class="informaltable"><table><tr>
<td class="parameter_name"><p>identifier</p></td>
<td class="parameter_description">
<p></p>
<p>Passed as <code class="code">identifier</code></p>
</td>
</tr></table></div>
</div>
</div>
</div>
</div>
<div class="footer">
<hr>Generated by GTK-Doc V1.33.1</div>
</body>
</html>
